<template>
	<view class="content">
		<view class="wid100 " :style="'background-image: url('+theme.my_back_img+');'"
			style="height: 422rpx;box-sizing: border-box;background-size: 100% 100%;">
			 <!-- 状态栏高度 -->
			<!-- #ifdef APP -->
			<view :style="{'height': statusBarHeight + 'px'}"></view>
			<view class="fowe600 coFFF dis disAl disJuC poRel" style="height: 44px;">
				<view class="poAbs hei100 dis disAl" style="top: 0;left: 20rpx;" @click="fanhui()">
					<uni-icons type="left" size="40rpx" color="#fff"></uni-icons>
				</view>
				<span>分销合伙人</span>
			</view>
			<view style="height: 30rpx;"></view>
			<!-- #endif -->
			
			<!-- #ifdef H5 -->
			<view style="height: 100rpx;"></view>
			<!-- #endif -->
			
			<view class="wid90 mar dis disAl disJuB">
				<view class="wid25" style="height: 138rpx;">
					<image :src="info.avatar" class="borRad50"
						style="width: 130rpx;height: 130rpx;border: 4rpx solid #fff;"></image>
				</view>
				<view class="coFFF" style="width: 75%;">
					<view class="dis disAl disJuB">
						<view>
							<view class="foSi50 fowe600" style="line-height: 44rpx;">{{info.name}}</view>
							<view class="foSi30 mar-top15" style="line-height: 44rpx;">{{info.phone}}</view>
						</view>
						<image src="../../static/shezhi.png" style="width: 30rpx;height: 30rpx;"></image>
					</view>
				</view>
			</view>
		</view>
		<view class="wid87 mar bacFFF borRad30" style="margin-top: -125rpx;box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0,0,0,0.1);">
			<view class="dis disAl" style="height: 128rpx;border-bottom: 1px solid #E5E5E5;">
				<view class="dis disAl disJuC" style="width: 50%;">
					<view class="textCen">
						<view class="fowe800 foSi40" style="line-height: 40rpx;">{{info.money}}</view>
						<view class="foSi20 mar-top10" style="color: #737373;">可提现(元)</view>
					</view>
				</view>
				<view class="dis disAl disJuC" style="width: 50%;">
					<view class="textCen">
						<view class="fowe800 foSi40" style="line-height: 40rpx;">0.00</view>
						<view class="foSi20 mar-top10" style="color: #737373;">未入账(元)</view>
					</view>
				</view>
			</view>
			<view class="wid80 mar">
				<view class="dis disAl disJuB" style="height: 138rpx;">
					<view class="textCen">
						<view class="fowe800 foSi30" style="line-height: 40rpx;">{{info.comm_num}}</view>
						<view class="foSi18 mar-top10" style="color: #737373;">累计佣金(元)</view>
					</view>
					<view class="textCen">
						<view class="fowe800 foSi30" style="line-height: 40rpx;">{{info.comm_num - info.money}}</view>
						<view class="foSi18 mar-top10" style="color: #737373;">已提现(元)</view>
					</view>
					<view class="textCen">
						<view class="fowe800 foSi30" style="line-height: 40rpx;">{{info.comm_num}}</view>
						<view class="foSi18 mar-top10" style="color: #737373;">总成交金额(元)</view>
					</view>
				</view>
				<view class="borRad40 dis disAl disJuC foSi25 fowe800 coFFF hei60" 
					:style="'background-color: '+theme.main_color+';'" @click="tiaozhuan('/pages/partner/withdraw?id='+info.id+'&shenfen=2')">我要提现</view>
				<view style="height: 30rpx;"></view>
			</view>
		</view>
		<view class="wid87 mar bacFFF mar-top20 borRad30" 
			style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0,0,0,0.1);padding: 30rpx 0;">
			<view class="wid80 mar dis disAl disJuB">
				<view @click="tiaozhuan('/pages/partner/brokerage')">
					<!-- <view class="mar" style="width: 60rpx;height: 60rpx;">
						<image src="../../static/yongjin.png" class="wh100"></image>
					</view> -->
					<view class="wid100 dis disAl disJuC" style="height: 60rpx;">
						<uni-icons custom-prefix="iconfont" size="50rpx" :color="theme.main_color"
							type="icon-for-close-account"></uni-icons>
					</view>
					<view class="foSi20 mar-top10 textCen">佣金流水</view>
				</view>
				<view @click="tiaozhuan('/pages/partner/invit')">
					<!-- <view class="mar" style="width: 60rpx;height: 60rpx;">
						<image src="../../static/yaoqingjiaru.png" class="wh100"></image>
					</view> -->
					<view class="wid100 dis disAl disJuC" style="height: 60rpx;">
						<uni-icons custom-prefix="iconfont" size="50rpx" :color="theme.main_color"
							type="icon-yaoqing"></uni-icons>
					</view>
					<view class="foSi20 mar-top10 textCen">我的邀请</view>
				</view>
				<view @click="tiaozhuan('/pages/partner/withdrawList')">
					<!-- <view class="mar" style="width: 60rpx;height: 60rpx;">
						<image src="../../static/tixian.png" class="wh100"></image>
					</view> -->
					<view class="wid100 dis disAl disJuC" style="height: 60rpx;">
						<uni-icons custom-prefix="iconfont" size="50rpx" :color="theme.main_color"
							type="icon-tixian"></uni-icons>
					</view>
					<view class="foSi20 mar-top10 textCen">提现记录</view>
				</view>
			</view>
		</view>
		<view class="wid87 mar bacFFF mar-top40 borRad30"
			style="box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0,0,0,0.1);padding: 44rpx 0;">
			<view class="wid95 mar">
				<view class="dis disAl disJuB">
					<view class="textCen" style="width: 48%;">
						<view class="foSi18">今日成交订单</view>
						<view class="mar-top10 fowe800 foSi30">{{info.today_order}}</view>
					</view>
					<view class="textCen" style="width: 48%;">
						<view class="foSi18">累计成交订单</view>
						<view class="mar-top10 fowe800 foSi30">{{info.order_num}}</view>
					</view>
				</view>
				<view class="dis disAl disJuB mar-top40">
					<view class="textCen" style="width: 48%;">
						<view class="foSi18">今日新增技师</view>
						<view class="mar-top10 fowe800 foSi30">{{info.today_technician}}</view>
					</view>
					<view class="textCen" style="width: 48%;">
						<view class="foSi18">累计入驻技师</view>
						<view class="mar-top10 fowe800 foSi30">{{info.tech_num}}</view>
					</view>
				</view>
				<view class="dis disAl disJuB mar-top40">
					<view class="textCen" style="width: 48%;">
						<view class="foSi18">今日邀请粉丝</view>
						<view class="mar-top10 fowe800 foSi30">{{info.today_user}}</view>
					</view>
					<view class="textCen" style="width: 48%;">
						<view class="foSi18">累计邀请粉丝</view>
						<view class="mar-top10 fowe800 foSi30">{{info.user_num}}</view>
					</view>
				</view>
			</view>
		</view>
		<view class="wid87 mar mar-top20" @click="tiaozhuan('/pages/partner/technicianInvit')"
			style="height: 164rpx;">
			<image src="../../static/yaoxin2.png" class="wh100"></image>
		</view>
		<view class="wid87 mar mar-top20" @click="tiaozhuan('/pages/partner/userInvit')"
			style="height: 151rpx;">
			<image src="../../static/yaoxin1.png" class="wh100"></image>
		</view>
		<view style="height: 50rpx;"></view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				url: this.global.url,
				info:[],
				theme: null,
				statusBarHeight: 0
			}
		},
		onLoad() {
			uni.setStorageSync('distr_agent','distr');
			this.theme = uni.getStorageSync('theme')
			console.log(uni.getSystemInfoSync()['statusBarHeight'])
			this.statusBarHeight = uni.getSystemInfoSync()['statusBarHeight']
			this.getinfo()
		},
		methods: {
			fanhui(){
				uni.navigateBack(1)
			},
			getinfo(){
				var that = this
				uni.request({
					url: that.global.url+'api/qianyu_smfw/distr/userinfo',
					method: 'POST',
					header:{
						'site-id': that.global.site_id,//自定义请求头信息
						'token': uni.getStorageSync('token')
					},
					data: {},
					success(res) {
					    let result = res.data
						console.log(result);
					    if(result.code == 1){
							that.info = result.data
						}else{
					        uni.showToast({
					            title: result.msg,
					            icon:'none',
								duration: 2000
					        })
					    }
					}
				})
			},
			tiaozhuan(url) {
				uni.navigateTo({
					url: url
				})
			}
		}
	}
</script>

<style>
	.content {}
</style>
